<template>
	<view>
		<view>
			<view style="margin-top:80upx">
				<view v-for="(item,index) in leaveArr" :key="index">
					<view v-if="index%2" class="indexTeacher" @click="managementIndexSkip(item)">
						<view style="margin-left:60upx">
							{{item.classDeptName}}
						</view>
						<view style="margin-right:20upx; font-size:28rpx">
						{{item.classroom}}	>
						</view>
					</view>
					<view v-else class="indexTeacher0" @click="managementIndexSkip(item)">
						<view style="margin-left:60upx">
							{{item.classDeptName}}
						</view>
						<view style="margin-right:20upx; font-size:28rpx">
						{{item.classroom}}	>
						</view>
					</view>
					
				</view>
			</view>
			
		</view>

	</view>
</template>

<script>
	import topCom from '../component/topCom.vue'
	import bottomCom from '../component/bottom.vue'
	export default {
		name:'leveRegistration',
		data(){
			return{
				userName:'',
				topName:'班级管理',
				leaveArr:[
					{
						icon:'',
						className:'启蒙星',
						classroom:'(初中部)'						
					},{
						icon:'',
						className:'BSCP'	,
						classroom:'(高中部)'					
					},{
						icon:'',
						className:'实训',
						classroom:'（就业部）'						
					},{
						icon:'',
						className:'课工场',
						classroom:'（大学生）'						
					},
				],
				Attbottoms:[ {
				    name:'home',
				    icon:'iconfont icon-yonghutongji',
				    text:"首页",
				    path: '/pages/classManagement/classManagementIndex'
				},
			
				{
				    name:'maintenance',
				    icon:'iconfont icon-shezhi',
				    text:"退出",
				    path: '/pages/index/login'
				},
				],
				classDeptId:1,
			}
		},
		components:{
			topCom,
			bottomCom
		},
		onShow() {
			var that = this
			uni.getStorage({
				key:'userRole',
				success(res) {
					that.userName = res.data
				}
			})
		},
		mounted(){
			this.getAppClassDept()
		},
		methods:{
			getAppClassDept(){
				this.$api.classManage.getAppClassDept().then(res=>{
					this.leaveArr = res.data
					this.leaveArr[0].classroom = '初中部'
					this.leaveArr[1].classroom = '高中部'
					this.leaveArr[2].classroom = '就业部'
					this.leaveArr[3].classroom = '大学部'
					
				})
			},
			managementIndexSkip(item){

				uni.setStorageSync("classDeptId",item.classDeptValue)
				uni.navigateTo({
					url:`/pages/classManagement/classManagementAttendance?classDeptId=${item.classDeptValue}`,
					success: res => {},
					fail: () => {},
					complete: () => {}
				});
			}
		}
	}
</script>

<style>
	.indexTeacher{
		margin: auto;
		margin-top:40upx;
		width:605upx;
		height:72upx;
		display: flex;
		justify-content: space-between;
		background-image: url(https://tj-1305380059.cos.ap-nanjing.myqcloud.com/pic/T-4.png);
		background-size: 100%;
		color:white;
		padding-top:30upx;
		font-size: 38rpx;
		/* opacity: 0.8; */
	}
	.indexTeacher0{
		margin: auto;
		margin-top:40upx;
		width:605upx;
		height:72upx;
		display: flex;
		justify-content: space-between;
		background-image: url(https://tj-1305380059.cos.ap-nanjing.myqcloud.com/pic/T-6.png);
		background-size: 100%;
		color:white;
		padding-top:30upx;
		font-size: 38rpx;
		/* opacity: 0.8; */
	}
	.content {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	}
	.indexContent{
		height: 100vh;
	}
</style>
